# -*- coding:utf8 -*-
import logging

from blog import setting
from blog.base.tools import MyWeb


"""
全局共用的虚拟拟浏览器
"""
WEB = MyWeb()


if setting.LEVEL == 0:
    logging.basicConfig(
        level=logging.DEBUG,
        format="[%(levelname)s] [%(filename)s line:%(lineno)d] : %(message)s"
    )
elif setting.LEVEL == 1:
    logging.basicConfig(
        level=logging.INFO,
        format="[%(levelname)s] [%(filename)s line:%(lineno)d] : %(message)s"
    )
else:   # 2
    logging.basicConfig(
        level=logging.WARNING,
        format="[%(levelname)s] [%(filename)s line:%(lineno)d] : %(message)s",
        filename=setting.LOGFILE,
        filemode='w'
    )
"""
全局的调试工具
"""
LOG = logging.getLogger("log")